package com.augurit.common.sysmeta.service;

import java.util.List;
import java.util.Map;

import org.springside.modules.orm.Page;

import com.augurit.common.base.service.IBaseService;
import com.augurit.common.syscode.web.form.SysCodeForm;
import com.augurit.common.sysmeta.service.impl.SysMetaColumnServiceImpl;
import com.augurit.common.sysmeta.web.form.SysMetaColumnForm;
import com.augurit.common.util.HqlUtils;

public interface ISysMetaColumnService extends IBaseService<SysMetaColumnForm, Long>{
	
	//机构数据字典
	public static final String SYS_CODE_NULLABLE = "AOS_COLUMN_NULLABLE";
	public static final String SYS_CODE_ISPRIMARYKEY = "AOS_COLUMN_ISPK";
	
	/**
	 * 根据tableId获取form对象列表
	 * @param id
	 * @return
	 */
	public Page<SysMetaColumnForm> getColumnsByTableId(Long tableId,Page<SysMetaColumnForm> page, Map<String, List<SysCodeForm>> sysCodeBuffer);
	
	public List<SysMetaColumnForm> getColumnsByTableId(Long tableId);
	
	public Page<SysMetaColumnForm> search(SysMetaColumnForm form,Page<SysMetaColumnForm> page, Map<String, List<SysCodeForm>> sysCodeBuffer);
	
	
	/**
	 * 根据表实体名获取字段page
	 * @param page
	 * @param entityNames
	 * @return
	 */
	public Page<SysMetaColumnForm> getColumnsGroupByEntityNames(Page<SysMetaColumnForm>page,String entityNames[],String condition);
	/**
	 * 根据表表名获取字段page
	 * @param page
	 * @param tableNames
	 * @return
	 */
	public Page<SysMetaColumnForm> getColumnsGroupByTableNames(Page<SysMetaColumnForm>page,String tableNames[],String condition);
	
	public List<SysMetaColumnForm> getColumnsGroupByTableNames(SysMetaColumnForm form, String tableNames[]);
	public List<SysMetaColumnForm> getColumnsByPropertyNames(String busEntityName,String queryProperties);
	
	/**
	 * 根据实体
	 * @param entityPropertyPairs
	 * @return
	 */
	public List<SysMetaColumnForm> getColumnsByTablesAndColumns(HqlUtils.TableColumnPair[] tableColumnPairs);
}
